﻿
CREATE PROCEDURE [dbo].[OPM_ReturnOrderHeader_GetList]
(
	@ReturnOrderStatusId  int
)

AS

	SELECT 		
		ROH.[Id],
		ROH.[ReturnOrderNumber],
		ROH.[ReturnOrderStatusId],
		ROH.[WangWangId],
		ROH.[CustomerName],
		ROH.[CustomerCellphone],
		ROH.[CustomerAddress],
		ROH.[CreatedBy],
		ROH.[UpdatedBy],
		ROH.[CreatedOn],
		ROH.[UpdatedOn]
	    FROM dbo.[OPM_ReturnOrderHeader] ROH
        
        WHERE 
	    (ROH.ReturnOrderStatusId = @ReturnOrderStatusId OR @ReturnOrderStatusId=0) 
	   
		ORDER BY ROH.[UpdatedOn] DESC